﻿using System;

namespace ClassLibrary1
{
    public class Events
    {
        public event EventHandler SystemChangedPublic;

        private event EventHandler SystemChangedPrivate;

        public void Subscribe(object x)
        {
            SystemChangedPrivate += (a, b) => Console.WriteLine(x);
        }

        public void RaisePrivate()
        {
            var handler = SystemChangedPrivate;
            if (handler != null)
            {
                handler(null, null);
            }
        }

        public void RaisePublic()
        {
            var handler = SystemChangedPublic;
            if (handler != null)
            {
                handler(null, null);
            }
        }
    }
}
